package com.example.demo12zuulprovider.controller;

import com.example.demo12zuulprovider.entity.Car;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalTime;

/**
 * @author Created by yawn on 2017-11-05 16:34
 */
@RestController
public class CarController {

    @GetMapping(value = "/car/{id}", produces = MediaType.APPLICATION_JSON_VALUE)
    public Car getCar(@PathVariable int id) throws InterruptedException {
        Thread.sleep(1000);
//        Thread.sleep(1000);
//        Thread.sleep(1000);
        return new Car(id, "name", "object", LocalTime.now());
    }
}
